package com.fyl.custom_spring_test.controller;

import com.fyl.custom_spring.beans.factory.BeanFactory;
import com.fyl.custom_spring.context.support.ClassPathXmlApplicationContext;
import com.fyl.spring.service.UserService;

import java.lang.reflect.InvocationTargetException;

public class UserController {
    public static void main(String[] args) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        BeanFactory context = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
        UserService userService = context.getBean("userService", UserService.class);

        userService.add();
    }
}
